
#include<iostream>
using namespace std;
int a[3][3],n;
int main()
{ int i,j,s1,s2;
  float ma1,ma2;
cout<<"n=";cin>>n;

for(i=0;i<n;i++)
 for(j=0;j<n;j++)
   {  cout<<"a["<<i<<"]["<<j<<"]=";
      cin>>a[i][j];
   }

s1=0;
for(i=0;i<n;i++)
      if(a[i][i]>0)
        {   s1=s1+a[i][i];
            ma1=s1/n;
        }
s2=0;
for(i=0;i<n;i++)
    if(a[i][n+1-i]>0)
    { s2=s2+a[i][j];
      ma2=s2/n;
    }

cout<<"media aritmetica de pe diag princ: ";cout<<ma1;
cout<<"media aritmetica de pe diag secundara: ";cout<<ma2;
}
